package com.app.hanoitips.travel.utils;

import com.app.hanoitips.travel.R;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;


public class ShowUtils extends Activity implements View.OnClickListener{
private ImageView imageView;
private Button btTaxi,btUtils,btFood,btSet;
private Intent openIntent;
SharedPreferences sp;
private int choice;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_menu);
		imageView=(ImageView) findViewById(R.id.ivIcon);
		btTaxi=(Button) findViewById(R.id.btRestaurant);
		btUtils=(Button) findViewById(R.id.btUtil);
		btFood=(Button) findViewById(R.id.btVNFood);
		btSet=(Button) findViewById(R.id.btSetting);
		btTaxi.setText("Taxi");
		imageView.setEnabled(false);
		imageView.setVisibility(View.INVISIBLE);
		btUtils.setEnabled(false);
		btUtils.setVisibility(View.INVISIBLE);
		btFood.setEnabled(false);
		btFood.setVisibility(View.INVISIBLE);
		btSet.setEnabled(false);
		btSet.setVisibility(View.INVISIBLE);
		
		btTaxi.setOnClickListener(this);
		
		sp=PreferenceManager.getDefaultSharedPreferences(this);
		choice=sp.getInt("keyLang", 0);
		
		if(choice==0){
			btTaxi.setText("Taxi");
		} else if(choice==1){
			btTaxi.setText("Taxi");
		}else{
			btTaxi.setText("Taxi");
		}
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
	 switch(v.getId()){		 
	 case R.id.btRestaurant:
		 openIntent=new Intent("android.intent.action.CustomizedListView");
		 Bundle taxiBundle=new Bundle();
		 taxiBundle.putString("key", "taxi");
		 openIntent.putExtras(taxiBundle);
		 startActivity(openIntent);
		 break;
	 }
	}

}
